<div id="main-content">
    <div id="main" class="main">
		<div class="user-hd">
			<h2>{$page_title}</h2>
		</div>
        <div class="spin-cont">
            <table>
                <tr>
                    <th class="spin-tit" style="width: 160px;">主机名</th>
                    <th class="spin-tit" style="width: 160px;">开通时间</th>
                    <th class="spin-tit" style="width: 160px;">合同到期日</th>
                    <th style="width: 130px;">本期计费金额</th>
                    <th style="width: 180px;">账户余额</th>
                    <th style="width: 80px;">影院状态</th>
                    <th style="width: 220px;">操作</th>
                </tr>
                <volist name="data_list_data[data_list]" id="vo">
                <tr>
                    <td class="spin-tit">{$vo.host_name}</td>
                    <td class="spin-tit">{$vo.cinema_name|default='--'}</td>
                    <td class="spin-tit">{$vo.user_name|default='--'}</td>
                    <td>{$vo.join_time|date='Y-m-d H:i', ###}</td>
                    <td>{$recharge_method_options[$vo[recharge_method_id]]|default="--"}</td>
                    <td>{$cinema_status_options[$vo[status]]}</td>
                    <td>{$vo.money}</td>
                    <td>
                        <if condition="1 EQ $vo[status]">
                            <a href="javascript:;" onclick="updateCinemaUser('{:U("Cinema/update", array("id"=>$vo[id], "status"=>2))}', '是否确定停用该用户？')" class="delfilebtn gray" >停用</a>
                        <else/>
                            <a href="javascript:;" onclick="updateCinemaUser('{:U("Cinema/update", array("id"=>$vo[id], "status"=>1))}', '是否确定启用该用户？')" class="delfilebtn gray" >启用</a>
                        </if>
                        &nbsp; | &nbsp;
                        <a href="javascript:;" onclick="initPassword('{:U("Cinema/initPassword", array("id"=>$vo[id]))}', '是否初始化密码？')" class="delfilebtn gray" >密码初始化</a>
                        <if condition="0 LT $vo[recharge_method_id]">
                        &nbsp; | &nbsp;
                        <a href="{:U('Cinema/recharge', array('id'=>$vo[id]))}" class="delfilebtn gray" >充值</a>
                        </if>
                        &nbsp; | &nbsp;
                        <a href="{:U('Cinema/edit', array('id'=>$vo[id]))}" class="delfilebtn gray" >编辑</a>
                        &nbsp; | &nbsp;
                        <a href="{:U('Cinema/userRechargeList', array('id'=>$vo[id]))}" class="delfilebtn gray" >计费详情</a>
                    </td>
                </tr>
                </volist>
            </table>
            <div class="page txt-center">
                {$data_list_data.pager}
            </div>
        </div>
    </div>
</div>
<script language="javascript">
    function initPassword(url, message)
    {
        swal({
            title: message,
            text: "",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#0C7AB9",
            cancelButtonText: "取消",
            confirmButtonText: "确定",
            closeOnConfirm: false
            },
            function(){
                $.ajax({
                    type:'post',
                    dataType:'json',
                    url: url,
                    success:function(data){
                        if (data.status==1) {
                            alertMessage(data.info, 1, 2);
                            if (data.url) {
                                delayGoToPage(data.url, 2000);
                            }
                        }else{
                            alertMessage(data.info, '', 2);
                        }
                    }
                });
            }
        );
    }
</script>